import requests

r=requests.get('https://www.baidu.com/')
r.encoding=r.apparent_encoding
print(type(r.text))
print(type(r.content.decode('utf-8')),r.apparent_encoding)